package com.fbinggun.fattribute.attribute.other;

import com.fbinggun.fattribute.FAttributePlugin;
import com.fbinggun.fattribute.attribute.AOther;
import com.fbinggun.fattribute.attribute.IAttribute;
import com.fbinggun.fattribute.effect.BanMoveEffect;
import com.fbinggun.fattribute.data.DataManage;
import com.fbinggun.fattribute.data.EntityData;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityDamageByEntityEvent;

import java.util.Map;

public class BanMove extends AOther{
    public Map<IAttribute,Double> modifyDamage(EntityData entityData, Map<IAttribute,Double> map, EntityDamageByEntityEvent event){
        if(event.getEntity() instanceof LivingEntity) {
            LivingEntity livingEntity= (LivingEntity) event.getEntity();
            EntityData entityData1= DataManage.getData(livingEntity);
            entityData1.addEffect(new BanMoveEffect( 20,getValue(entityData)*20,entityData));

        }

        return map;
    }


    @Override
    public String getKey() {
        return FAttributePlugin.plugin.getConfigKey("BanMove");
    }


    @Override
    public int getCombat() {
        return 10;
    }
    @Override
    public String getID() {
        return "BanMove";
    }

}
